import logging
import yagmail
def log_set():
    logging.basicConfig(level=logging.DEBUG,format='%(levelno)s_%(asctime)s_%(message)s',filename='log.txt')

def send_mail(filename):
    mail = yagmail.SMTP(user='2248557244@qq.com',password='zhbyrpmsxmufdjde',host='smtp.qq.com')
    mail.send(to='2248557244@qq.com',subject='上课测试',contents='我在学习',attachments=filename)